#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
struct student
{
	int a;
	char b[3];
	float c[3];
}s1, s2, s3, s4, s5;
void input(struct student* s)
{
	scanf("%d", &(s->a));
	for (int i = 0; i < 3; i++)
	{
		scanf("%c", &(s->b[i]));
	}
	for (int i = 0; i < 3; i++)
	{
		scanf("%f", &(s->c[i]));
	}
}

float average(float  * d)
{
	return (d[0] + d[1] + d[2]) / 3;
}
float max(float a, float b, float c, float d, float e)
{
	float f = (a > b) ? a : b;
	float g = (f > c) ? f : c;
	float h = (g > d) ? g : d;
	float i = (h > e) ? h : e;
	return i;
}
int main()
{
	struct studet* s11 = &s1;
	struct studet* s22 = &s2;
	struct studet* s33 = &s3;
	struct studet* s44 = &s4;
	struct studet* s55 = &s5;
	input(s11);
	input(s22);
	input(s33);
	input(s44);
	input(s55);
	float a1 = average(s1.c);
	float a2 = average(s2.c);
	float a3 = average(s3.c);
	float a4 = average(s4.c);
	float a5 = average(s5.c);
	printf("%f\n", (a1 + a2 + a3 + a4 + a5) / 5);
	float p = max(a1, a2, a3, a4, a5);
	struct student ss;
	if (p == a1)
		ss = s1;
	if (p == a2)
		ss = s2;
	if (p == a3)
		ss = s3;
	if (p == a4)
		ss = s4;
	if (p == a5)
		ss = s5;

	printf("%d\n", ss.a);
	for (int i = 0; i < 3; i++)
	{
		printf("%c\n", ss.b[i]);
	}
	for (int i = 0; i < 3; i++)
	{
		printf("%f\n", ss.c[i]);
	}
	return 0;
}
